package com.robert.springboot.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.UUID;

@RestController
@RequestMapping(value = "helloworld")
@Slf4j
public class HelloWorldController {
    /**
     * http://localhost:8080/helloworld/success
     *
     * @return
     */
    @GetMapping(value = "success")
    public String success(HttpServletRequest request) {
        log.info("Receive a reuqest: {}", request.getRequestURI());
        return "success: " + UUID.randomUUID();
    }
}
